//
//  XLFirimAppDisLatestInfo.m
//  AFNetworking
//
//  Created by ilongge on 2022/5/20.
//

#import "XLFirimAppDisLastestInfo.h"

@implementation XLFirimAppDisLastestInfo
-(instancetype)initWith:(NSDictionary *)infoDict
{
    if (self = [super init]) {
        _name = infoDict[@"name"];
        _version = infoDict[@"version"];
        _changelog = infoDict[@"changelog"];
        _updated_at = infoDict[@"updated_at"];
        _versionShort = infoDict[@"versionShort"];
        _build = infoDict[@"build"];
        _install_url = infoDict[@"install_url"];
        _direct_install_url = infoDict[@"direct_install_url"];
        _update_url = infoDict[@"update_url"];
    }
    return self;
}
- (NSString *)description
{
    NSMutableString *description = [[NSMutableString alloc] init];
    [description appendFormat:@"<%@: %p>\n",[self class], self];
    [description appendString:@"{\n"];
    if (_name) {
        [description appendFormat:@"\t\"name\" : \"%@\",\n", _name];
    }
    else{
        [description appendString:@"\t\"name\" : \"nil\",\n"];
    }
    if (_version) {
        [description appendFormat:@"\t\"version\" : \"%@\",\n", _version];
    }
    else{
        [description appendString:@"\t\"version\" : \"nil\",\n"];
    }
    if (_changelog) {
        [description appendFormat:@"\t\"changelog\" : \"%@\",\n", [_changelog stringByReplacingOccurrencesOfString:@"\n" withString:@","]];
    }
    else{
        [description appendString:@"\t\"changelog\" : \"nil\",\n"];
    }
    if (_updated_at != nil) {
        [description appendFormat:@"\t\"updated_at\" : \"%@\",\n", _updated_at];
    }
    else{
        [description appendString:@"\t\"updated_at\" : \"nil\",\n"];
    }
    if (_versionShort) {
        [description appendFormat:@"\t\"versionShort\" : \"%@\",\n", _versionShort];
    }
    else{
        [description appendString:@"\t\"versionShort\" : \"nil\",\n"];
    }
    if (_build) {
        [description appendFormat:@"\t\"build\" : \"%@\",\n", _build];
    }
    else{
        [description appendString:@"\t\"build\" : \"nil\",\n"];
    }
    if (_install_url) {
        [description appendFormat:@"\t\"install_url\" : \"%@\",\n", _install_url];
    }
    else{
        [description appendString:@"\t\"install_url\" : \"nil\",\n"];
    }
    if (_direct_install_url) {
        [description appendFormat:@"\t\"direct_install_url\" : \"%@\",\n", _direct_install_url];
    }
    else{
        [description appendString:@"\t\"direct_install_url\" : \"nil\",\n"];
    }
    if (_update_url) {
        [description appendFormat:@"\t\"update_url\" : \"%@\",\n", _update_url];
    }
    else{
        [description appendString:@"\t\"update_url\" : \"nil\",\n"];
    }
    [description appendString:@"}"];
    return description;
}
@end
